29 research outputs found

    Bejeweled, Candy Crush and other Match-Three Games are (NP-)Hard

    Full text link
    The twentieth century has seen the rise of a new type of video games targeted at a mass audience of "casual" gamers. Many of these games require the player to swap items in order to form matches of three and are collectively known as \emph{tile-matching match-three games}. Among these, the most influential one is arguably \emph{Bejeweled} in which the matched items (gems) pop and the above gems fall in their place. Bejeweled has been ported to many different platforms and influenced an incredible number of similar games. Very recently one of them, named \emph{Candy Crush Saga} enjoyed a huge popularity and quickly went viral on social networks. We generalize this kind of games by only parameterizing the size of the board, while all the other elements (such as the rules or the number of gems) remain unchanged. Then, we prove that answering many natural questions regarding such games is actually \NP-Hard. These questions include determining if the player can reach a certain score, play for a certain number of turns, and others. We also \href{http://candycrush.isnphard.com}{provide} a playable web-based implementation of our reduction.Comment: 21 pages, 12 figure

    The Max-Distance Network Creation Game on General Host Graphs

    Full text link
    In this paper we study a generalization of the classic \emph{network creation game} in the scenario in which the nn players sit on a given arbitrary \emph{host graph}, which constrains the set of edges a player can activate at a cost of α0\alpha \geq 0 each. This finds its motivations in the physical limitations one can have in constructing links in practice, and it has been studied in the past only when the routing cost component of a player is given by the sum of distances to all the other nodes. Here, we focus on another popular routing cost, namely that which takes into account for each player its \emph{maximum} distance to any other player. For this version of the game, we first analyze some of its computational and dynamic aspects, and then we address the problem of understanding the structure of associated pure Nash equilibria. In this respect, we show that the corresponding price of anarchy (PoA) is fairly bad, even for several basic classes of host graphs. More precisely, we first exhibit a lower bound of Ω(n/(1+α))\Omega (\sqrt{ n / (1+\alpha)}) for any α=o(n)\alpha = o(n). Notice that this implies a counter-intuitive lower bound of Ω(n)\Omega(\sqrt{n}) for very small values of α\alpha (i.e., edges can be activated almost for free). Then, we show that when the host graph is restricted to be either kk-regular (for any constant k3k \geq 3), or a 2-dimensional grid, the PoA is still Ω(1+min{α,nα})\Omega(1+\min\{\alpha, \frac{n}{\alpha}\}), which is proven to be tight for α=Ω(n)\alpha=\Omega(\sqrt{n}). On the positive side, if αn\alpha \geq n, we show the PoA is O(1)O(1). Finally, in the case in which the host graph is very sparse (i.e., E(H)=n1+k|E(H)|=n-1+k, with k=O(1)k=O(1)), we prove that the PoA is O(1)O(1), for any α\alpha.Comment: 17 pages, 4 figure

    Rational Fair Consensus in the GOSSIP Model

    Full text link
    The \emph{rational fair consensus problem} can be informally defined as follows. Consider a network of nn (selfish) \emph{rational agents}, each of them initially supporting a \emph{color} chosen from a finite set Σ \Sigma. The goal is to design a protocol that leads the network to a stable monochromatic configuration (i.e. a consensus) such that the probability that the winning color is cc is equal to the fraction of the agents that initially support cc, for any cΣc \in \Sigma. Furthermore, this fairness property must be guaranteed (with high probability) even in presence of any fixed \emph{coalition} of rational agents that may deviate from the protocol in order to increase the winning probability of their supported colors. A protocol having this property, in presence of coalitions of size at most tt, is said to be a \emph{whp\,-tt-strong equilibrium}. We investigate, for the first time, the rational fair consensus problem in the GOSSIP communication model where, at every round, every agent can actively contact at most one neighbor via a \emph{push//pull} operation. We provide a randomized GOSSIP protocol that, starting from any initial color configuration of the complete graph, achieves rational fair consensus within O(logn)O(\log n) rounds using messages of O(log2n)O(\log^2n) size, w.h.p. More in details, we prove that our protocol is a whp\,-tt-strong equilibrium for any t=o(n/logn)t = o(n/\log n) and, moreover, it tolerates worst-case permanent faults provided that the number of non-faulty agents is Ω(n)\Omega(n). As far as we know, our protocol is the first solution which avoids any all-to-all communication, thus resulting in o(n2)o(n^2) message complexity.Comment: Accepted at IPDPS'1

    Large Peg-Army Maneuvers

    Get PDF
    Despite its long history, the classical game of peg solitaire continues to attract the attention of the scientific community. In this paper, we consider two problems with an algorithmic flavour which are related with this game, namely Solitaire-Reachability and Solitaire-Army. In the first one, we show that deciding whether there is a sequence of jumps which allows a given initial configuration of pegs to reach a target position is NP-complete. Regarding Solitaire-Army, the aim is to successfully deploy an army of pegs in a given region of the board in order to reach a target position. By solving an auxiliary problem with relaxed constraints, we are able to answer some open questions raised by Cs\'ak\'any and Juh\'asz (Mathematics Magazine, 2000). To appreciate the combinatorial beauty of our solutions, we recommend to visit the gallery of animations provided at http://solitairearmy.isnphard.com.Comment: Conference versio

    Specializations and Generalizations of the Stackelberg Minimum Spanning Tree Game

    Full text link
    Let be given a graph G=(V,E)G=(V,E) whose edge set is partitioned into a set RR of \emph{red} edges and a set BB of \emph{blue} edges, and assume that red edges are weighted and form a spanning tree of GG. Then, the \emph{Stackelberg Minimum Spanning Tree} (\stack) problem is that of pricing (i.e., weighting) the blue edges in such a way that the total weight of the blue edges selected in a minimum spanning tree of the resulting graph is maximized. \stack \ is known to be \apx-hard already when the number of distinct red weights is 2. In this paper we analyze some meaningful specializations and generalizations of \stack, which shed some more light on the computational complexity of the problem. More precisely, we first show that if GG is restricted to be \emph{complete}, then the following holds: (i) if there are only 2 distinct red weights, then the problem can be solved optimally (this contrasts with the corresponding \apx-hardness of the general problem); (ii) otherwise, the problem can be approximated within 7/4+ϵ7/4 + \epsilon, for any ϵ>0\epsilon > 0. Afterwards, we define a natural extension of \stack, namely that in which blue edges have a non-negative \emph{activation cost} associated, and it is given a global \emph{activation budget} that must not be exceeded when pricing blue edges. Here, after showing that the very same approximation ratio as that of the original problem can be achieved, we prove that if the spanning tree of red edges can be rooted so as that any root-leaf path contains at most hh edges, then the problem admits a (2h+ϵ)(2h+\epsilon)-approximation algorithm, for any ϵ>0\epsilon > 0.Comment: 22 pages, 7 figure

    Multiple-Edge-Fault-Tolerant Approximate Shortest-Path Trees

    Full text link
    Let GG be an nn-node and mm-edge positively real-weighted undirected graph. For any given integer f1f \ge 1, we study the problem of designing a sparse \emph{f-edge-fault-tolerant} (ff-EFT) σ\sigma{\em -approximate single-source shortest-path tree} (σ\sigma-ASPT), namely a subgraph of GG having as few edges as possible and which, following the failure of a set FF of at most ff edges in GG, contains paths from a fixed source that are stretched at most by a factor of σ\sigma. To this respect, we provide an algorithm that efficiently computes an ff-EFT (2F+1)(2|F|+1)-ASPT of size O(fn)O(f n). Our structure improves on a previous related construction designed for \emph{unweighted} graphs, having the same size but guaranteeing a larger stretch factor of 3(f+1)3(f+1), plus an additive term of (f+1)logn(f+1) \log n. Then, we show how to convert our structure into an efficient ff-EFT \emph{single-source distance oracle} (SSDO), that can be built in O~(fm)\widetilde{O}(f m) time, has size O(fnlog2n)O(fn \log^2 n), and is able to report, after the failure of the edge set FF, in O(F2log2n)O(|F|^2 \log^2 n) time a (2F+1)(2|F|+1)-approximate distance from the source to any node, and a corresponding approximate path in the same amount of time plus the path's size. Such an oracle is obtained by handling another fundamental problem, namely that of updating a \emph{minimum spanning forest} (MSF) of GG after that a \emph{batch} of kk simultaneous edge modifications (i.e., edge insertions, deletions and weight changes) is performed. For this problem, we build in O(mlog3n)O(m \log^3 n) time a \emph{sensitivity} oracle of size O(mlog2n)O(m \log^2 n), that reports in O(k2log2n)O(k^2 \log^2 n) time the (at most 2k2k) edges either exiting from or entering into the MSF. [...]Comment: 16 pages, 4 figure

    Improved Purely Additive Fault-Tolerant Spanners

    Full text link
    Let GG be an unweighted nn-node undirected graph. A \emph{β\beta-additive spanner} of GG is a spanning subgraph HH of GG such that distances in HH are stretched at most by an additive term β\beta w.r.t. the corresponding distances in GG. A natural research goal related with spanners is that of designing \emph{sparse} spanners with \emph{low} stretch. In this paper, we focus on \emph{fault-tolerant} additive spanners, namely additive spanners which are able to preserve their additive stretch even when one edge fails. We are able to improve all known such spanners, in terms of either sparsity or stretch. In particular, we consider the sparsest known spanners with stretch 66, 2828, and 3838, and reduce the stretch to 44, 1010, and 1414, respectively (while keeping the same sparsity). Our results are based on two different constructions. On one hand, we show how to augment (by adding a \emph{small} number of edges) a fault-tolerant additive \emph{sourcewise spanner} (that approximately preserves distances only from a given set of source nodes) into one such spanner that preserves all pairwise distances. On the other hand, we show how to augment some known fault-tolerant additive spanners, based on clustering techniques. This way we decrease the additive stretch without any asymptotic increase in their size. We also obtain improved fault-tolerant additive spanners for the case of one vertex failure, and for the case of ff edge failures.Comment: 17 pages, 4 figures, ESA 201

    Dynamic mechanism design

    Get PDF
    AbstractIn this paper we address the question of designing truthful mechanisms for solving optimization problems on dynamic graphs with selfish edges. More precisely, we are given a graph G of n nodes, and we assume that each edge of G is owned by a selfish agent. The strategy of an agent consists in revealing to the system–at each time instant–the cost at the actual time for using its edge. Additionally, edges can enter into and exit from G. Among the various possible assumptions which can be made to model how this edge-cost modifications take place, we focus on two settings: (i) the dynamic, in which modifications can happen at any time, and for a given optimization problem on G, the mechanism has to maintain efficiently the output specification and the payment scheme for the agents; (ii) the time-sequenced, in which modifications happens at fixed time steps, and the mechanism has to minimize an objective function which takes into consideration both the quality and the set-up cost of a new solution. In both settings, we investigate the existence of exact and approximate truthful (w.r.t. to suitable equilibrium concepts) mechanisms. In particular, for the dynamic setting, we analyze the minimum spanning tree problem, and we show that if edge costs can only decrease and each agent adopts a myopic best response strategy (i.e., its utility is only measured instantaneously), then there exists an efficient dynamic truthful (in myopic best response equilibrium) mechanism for handling a sequence of k declarations of edge-cost reductions having runtime O((h+k)logn), where h is the overall number of payment changes
    corecore